library ykfview;

import 'package:flutter/material.dart';

class YkClickWidget extends StatelessWidget {
  final Widget? child;
  final Function onClick;

  const YkClickWidget({super.key,required this.onClick, this.child});

  @override
  Widget build(BuildContext context) {
    int clickTime = 0;
    return GestureDetector(
      behavior: HitTestBehavior.opaque,
      onTap: () {
        int time = DateTime.now().millisecondsSinceEpoch;
        if (time - clickTime < 500) {

        } else {
          onClick();
        }
        clickTime = time;
      },
      child: child,
    );
  }

}